package com.elem.service.impl;

import com.elem.bean.Business;
import com.elem.bean.DeliveryAddress;
import com.elem.bean.Food;
import com.elem.bean.OrderDetailet;
import com.elem.dao.DeliveryAddressDao;
import com.elem.dao.impl.DeliveryAddressDaoImpl;
import com.elem.service.DeliveryAddressService;

import java.util.List;

public class DeliveryAddressServiceImpl implements DeliveryAddressService {
    DeliveryAddressDao deliveryAddressDao=new DeliveryAddressDaoImpl();



    @Override
    public DeliveryAddress getDeliveryAddressById(String daId) throws Exception {
//        获取DeliveryAddress的  daId
        DeliveryAddress deliveryAddress = deliveryAddressDao.getDeliveryAddressById(daId);

        return deliveryAddress;

    }

    @Override
    public int saveDeliveryAddress(DeliveryAddress deliveryAddress) throws Exception {
        int i=deliveryAddressDao.saveDeliveryAddress(deliveryAddress);
        return i;
    }

    @Override
    public List<DeliveryAddress> listDeliveryAddressByUserId(String userId) throws Exception {
        List<DeliveryAddress> list = deliveryAddressDao.listDeliveryAddressByUserId(userId);
        return list;

    }

    @Override
    public int removeDeliveryAddress(DeliveryAddress deliveryAddress) throws Exception {
        int i=deliveryAddressDao.removeDeliveryAddress(deliveryAddress);
        return i;

    }

    @Override
    public int updateDeliveryAddress(DeliveryAddress deliveryAddress) throws Exception {
        int i=deliveryAddressDao.updateDeliveryAddress(deliveryAddress);
        return i;
    }
}
